package com.unism.base.resource;

import java.util.HashMap;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

import com.unism.common.aop.logger.Logor;

/**
 * 
 * Service class that handles REST requests
 * 
 * @author amacoder
 * 
 */
@Component("usersResource")
@Path("/user")
public class UserResource {
	@Autowired()
    private RedisTemplate<String, HashMap<String, String>> redisTemplate;
	
	@GET
	@Path("/register")
	@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
	@Logor(value = "注册账户")
	public Response register(@QueryParam("httpUserStr") String httpUserStr) throws Exception {

		return Response.status(200).entity("hello")
				.header("Access-Control-Allow-Headers", "X-extra-header").allow("OPTIONS").build();
	}


}
